设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14140|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 h  P3 U, n$ b+ V, ~1 i3 x* r6 @) ]3 I# K2 a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 z& g+ ]. y4 s! t' a0 r
% t5 I) x0 _. L: L- Ubegin P_read arriving
8 [9 j' D! [7 g' l$ K    while 1=1 do begin7 m+ Z- M) m1 J4 u9 h3 O" V
        read A_tote from "data.txt" with delimiter "\n"
* x; p0 r, H( U: {) B! x        read A_time from "data.txt" with delimiter "\n"
! S9 H7 W5 p" a4 Y9 K  J* Y        read A_leave from "data.txt" with delimiter "\n"* r  o( |' P5 X1 y
        read A_picks from "data.txt" with delimiter "\n"
/ }) S9 y9 S5 B6 ~- i        set load type to A_tote. U* ?4 N; p' h2 \9 F+ f
        if A_tote="tote 1" then set A_induct to 1
/ M3 q; H# O2 H7 q4 g2 D2 }        else if A_tote="tote 2" then set A_induct to 2% D" G6 f5 I0 C% _9 T7 k
            else set A_induct to 3   
( g$ l2 [! P: O  |0 U8 r        set A_i to 0
& i" y  X: n4 d& z/ @        clone 1 load to P_induction( P& I3 s1 i& w$ W
        wait for A_time sec6 k9 @* o3 c+ l# b
    end, o3 G4 [% _# S3 ]. J, a
end+ d( _1 ^- t3 k8 }; J
: D9 e" a/ H2 o/ C  M
begin P_induction arriving
0 A8 P' A6 X1 @, J9 n    if A_induct=1 then clone 1 load to P_pick1# J( p2 H, G1 V4 K: Z+ d2 J
    else if A_induct=2 then clone 1 load to P_pick2- u* F! e6 M2 Y' |
        else clone 1 load to P_pick3
. P2 M' t, M# D/ N- m/ M% ^end
& h" j8 z- @$ v  |
% }# N/ Q3 D# z# B  mbegin P_pick1 arriving
# Q: u* y8 ~5 N7 c    set A_i to 1) `! h  m/ j% H% p  Y
    move into Q_induct1- x3 ^) U8 u8 Y1 p# ]6 F' f9 z
    move into pickaisle.induct1
  T/ i4 C  h, a- _) r- w    while A_i<=30 do begin$ c7 ^0 F2 i5 T  O
        travel to pickaisle.con(A_i)
! [: W# P3 u: ]& i! {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 c, W( N' e% P6 o3 @& w2 V6 X" O
        else wait for 10 sec% f5 X3 W) [2 M& |. `  N( u, U( p9 t( N
        if A_i=A_leave then send to die
" r& C% v  k4 l9 L0 Q" f2 y        else inc A_i by 1  D1 x* ^, p2 r: K+ X+ i
    end: }. I0 {4 c8 Z+ Q* k9 m% c# }
end
' f1 q7 a( U! |
, I2 U4 o' l- m) ^4 g& x4 W2 v6 Kbegin P_pick2 arriving1 B0 c% B: h) ?( |# |
    set A_i to 11% ]* m: W4 G0 ]! E5 {, U; t  Q
    move into Q_induct2
% X) \( ~4 Y# _: A2 ?* Y* ^3 [/ i    move into pickaisle.induct21 \! ^1 l0 G; j0 d6 {  I+ \+ u
    while A_i<=30 do begin
8 @- M- ]# I! b( t. q' W        travel to pickaisle.con(A_i)
- Z+ M" m" E1 `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: q2 W+ ~; i" o
        else wait for 10 sec
+ Z8 |( D: W0 @        if A_i=A_leave then send to die3 X7 {) s! P8 U" {. v, b( H
        else inc A_i by 1
& u9 G4 O0 {% X" E; Z, K$ J8 t9 F# p    end
  c5 l6 [; ^; e0 S. Iend
5 \8 B" m' R2 ~- t$ p, }! a; H  ]. k2 O+ F( M
begin P_pick3 arriving
6 S' l4 f, [3 W6 K4 P! ~    set A_i to 21
6 y5 n7 i" y# d8 V4 I    move into Q_induct3
% v% A6 ]8 v2 a; T5 h+ `* g* o    move into pickaisle.induct3* F9 M6 S+ r& @: I
    while A_i<=30 do begin
8 C2 i- ^- x+ E' y1 A+ N        travel to pickaisle.con(A_i)
0 m; ]* P+ R5 P4 [; I4 |5 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 R, ]# j0 }" t" k! c+ Z- {
        else wait for 10 sec$ a5 L. N" x! r5 `0 F3 B
        if A_i=A_leave then send to die1 E4 b3 I8 {; U' }7 C
        else inc A_i by 1
' b6 @* H2 n  C    end
* p5 Y3 K* V: u' M* B8 Bend

最佳答案

查看完整内容

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是个什么东东?
% q- m& O6 q3 J! _8 Imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 b* I4 m- [/ b* ?3 z! }! f
3 T: J6 B: B* _; lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ ~4 D- z& w) O* x* I  [  \

# c5 H2 ~4 k$ V  M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) O7 M6 [/ k4 {1 d1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 {  t& L3 O7 n+ C9 I0 R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% t1 d7 C( v3 ?& q. r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, n/ P2 I/ B9 ^7 Z0 Y+ B5 ibegin P_induction arriving  B) r0 Q6 R3 }) \3 _$ [
    clone 1 load to P_pick(A_induct)! S& J( B- S5 C
end最大的系
7 X% A) P' `$ K; ]7 j  z) r  ?% r
9 c1 [* a8 M3 U% e- R' ibegin P_pick arriving) H. F5 h: [/ U8 C% e
    set A_i to procindex * 10 + 1
6 N9 O: ^/ S) ^4 S" N    move into Q_induct(procindex)
; d( s7 U( m5 |" ^    move into pickaisle.induct(procindex)
3 M0 |7 j8 n0 W- U" _/ `    /*check the type of pickaisle.induct(i), for your last problem.*/
; L8 i* R# j" E/ ?/ n# l! m" y! l- [4 C* X
    while A_i<=30 do begin
! U) s7 z$ `7 r3 a" y        travel to pickaisle.con(A_i)2 i7 ~! H- i. W3 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 b2 g5 u, h2 T8 t, X! q
        else wait for 10 sec
( w0 b2 }  e6 R' P8 {        if A_i=A_leave then send to die
. E8 X" @7 |# c. ~        else inc A_i by 1
. w" l, ]2 ^6 e2 y2 h1 T    end9 v6 O6 e; U7 M- l9 d% U
end3 p  T' N! P, w( ?7 O  q
- u) x! U* ^- p, K
其中的procindex为整形,代表当前process的序号。
$ W9 w  i9 n0 Y, f8 |& ^/ C4 s' Ustation和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, 2026-6-13 06:57 , Processed in 0.015102 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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