设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11583|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 \( `) O+ E- t
2 @0 r0 x- X) ?  J. W" ^6 `( T
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。1 s. F/ u; ^) j2 X1 w+ F, {
1 }: r$ M  G8 f$ c8 H. I5 P1 v
begin P_read arriving
1 F4 q' ~1 s; e0 a, C* F    while 1=1 do begin
  F6 [4 q. E0 N' g% D# Q& i        read A_tote from "data.txt" with delimiter "\n"
) Q# w0 X4 c  O0 W/ t2 N% Z* D        read A_time from "data.txt" with delimiter "\n"- [; ^! A, [3 e. O6 t4 C
        read A_leave from "data.txt" with delimiter "\n"3 h& O& \4 N3 ~( a
        read A_picks from "data.txt" with delimiter "\n"5 {* Y# y# N6 y) S, W5 S6 \
        set load type to A_tote
& L7 ?0 S) N# @0 p/ \        if A_tote="tote 1" then set A_induct to 1
" O6 E$ C7 L9 [$ X. u        else if A_tote="tote 2" then set A_induct to 2
) P% ?* f# ^6 z, Z# R% N8 @& l            else set A_induct to 3   
9 U. x4 j. r. d2 Y! t; C        set A_i to 0
2 O' b, U' q8 r+ R5 |/ S        clone 1 load to P_induction
5 G! D2 D3 B8 n* O- h: `        wait for A_time sec# b9 A4 a, m; `9 u
    end1 I! j$ t* u. j: N$ O/ S
end
/ Q3 x; C' L9 n& i
9 ~  a2 k0 p* f! `begin P_induction arriving
6 y) y- r* ?5 `1 E. l) V+ F5 t0 I    if A_induct=1 then clone 1 load to P_pick16 {6 t3 K/ u, C3 m: d. j$ H8 Y
    else if A_induct=2 then clone 1 load to P_pick2
+ y3 }$ G; L* U6 D; H        else clone 1 load to P_pick3
# `2 ^3 o6 E9 I, kend# y7 K1 R- c; _' Z2 ~

5 t- L2 {& B2 J$ Abegin P_pick1 arriving
6 D4 Y: Y. @4 r" A2 q; H    set A_i to 1
0 r- t' b/ O4 J, w) P0 g+ o    move into Q_induct1- q! d" q; V) x
    move into pickaisle.induct1
, a) y9 C9 a& o    while A_i<=30 do begin
( u- ?4 C  @" B, U        travel to pickaisle.con(A_i)  V5 Q9 _1 I* F) |7 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Q8 S+ e; G) x1 n& T
        else wait for 10 sec
9 [! `" a/ p3 k8 g0 M% X6 Z0 A9 G        if A_i=A_leave then send to die
; W) Z+ N6 M8 `. z! B# |, {        else inc A_i by 11 C8 Q' \& e" d
    end
/ e) m4 [1 Y. h  ]end& V$ j8 w$ J3 a

; |3 `$ K( t  F' y7 h- d2 {begin P_pick2 arriving
& B5 |: O9 U, @0 d    set A_i to 11
4 i6 R( \/ r; ~% a5 y9 e    move into Q_induct2+ x1 w6 D% C8 v. m) s* f& x5 W$ E
    move into pickaisle.induct28 H( ^5 A1 d0 P1 W: s5 `" x, |
    while A_i<=30 do begin
6 a& e0 o. g  F        travel to pickaisle.con(A_i)/ z1 y' F  w$ x6 S6 p8 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z( u: `3 |2 J( a: y# d
        else wait for 10 sec: ^9 K4 L) U5 @3 a+ @0 j2 R
        if A_i=A_leave then send to die
* B) \/ U) V0 K3 x0 J$ C. R- O        else inc A_i by 16 ]& g9 U/ o. ?: X
    end
" r+ O) Z5 q" _% oend
9 b$ ^! Z3 W. @- z% r$ Q% j) \! W* T2 p
begin P_pick3 arriving7 ~, r4 U( ~$ i2 m  f
    set A_i to 21
1 A0 [+ j. W+ J. T- t    move into Q_induct3
7 Y/ c! H) V" b8 @# Y    move into pickaisle.induct39 d0 f6 ~' Y6 p$ Y1 H6 M6 _7 b* a1 X
    while A_i<=30 do begin
+ D# x$ x. t& D2 E        travel to pickaisle.con(A_i); ~$ ^9 g0 b; y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' w! |9 ?8 F0 X; N2 W5 L        else wait for 10 sec
4 B$ z# ?/ M* [+ U2 o. F0 C        if A_i=A_leave then send to die$ c$ e& d  i* Y/ ]4 O/ n6 a0 \
        else inc A_i by 1
$ P/ ~- Z2 a8 r: G9 W    end
/ x/ A! J6 [+ S, i4 n# Vend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
2 h+ @) |- d& ^- I- Smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- Q0 h+ b& A: d$ s$ `3 m- c
" d3 s9 K1 V- ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& |( Z% ^/ ?# A" `( M( H* f+ ^& b; c/ D, H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% E7 \8 z* e& u1 B2 K/ P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 Y" r* f' a: B) w% G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) K  X4 F' @3 R* t# z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# Z; j, z- {4 L5 B8 Dbegin P_induction arriving0 b, I# h3 L8 [
    clone 1 load to P_pick(A_induct)
2 |% V$ j  Q2 O* P6 c: C- kend最大的系% S  w1 I: G4 M
, [0 H( U$ m1 [. Z# l8 o/ g
begin P_pick arriving
) e( g8 R- C& L+ v    set A_i to procindex * 10 + 12 t5 c' S3 r/ o$ [# k
    move into Q_induct(procindex)! h6 ]4 R" A7 E1 Q" [! J" R
    move into pickaisle.induct(procindex)
- K( A1 J! E+ y0 G- L1 v8 \( E    /*check the type of pickaisle.induct(i), for your last problem.*/( ~3 e4 \0 D' X, B: f* K7 X

- S# m/ E8 g# N; W5 d# _6 @    while A_i<=30 do begin3 Z; S  `% r2 |% P
        travel to pickaisle.con(A_i)
& |7 h4 h* {3 |6 R, h2 O& o: x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ]# `, o" ^0 U/ g( a
        else wait for 10 sec
6 E$ b2 ]' b( c/ {! n9 Q% H0 n        if A_i=A_leave then send to die0 P* K, K+ N, y% G+ P
        else inc A_i by 1: w- b4 d1 C  T$ }
    end; U4 P- e" h5 K0 _( U  E
end' c: y5 X5 L9 d+ u
) J# C' L: c" E8 y# c
其中的procindex为整形,代表当前process的序号。
% p3 r. O2 d2 _; o6 A, _station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2025-11-22 03:47 , Processed in 0.016552 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表