设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14353|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# i8 q: `- ^, l4 ?9 t6 ~% v4 j( E6 x8 P3 l5 c, Z, E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ N- z, Y# ^. U" t* B) V# i/ V. y4 \4 D" A$ C  m' I2 [
begin P_read arriving
. b9 x% {$ K# B1 X2 |% i    while 1=1 do begin! G& h/ J6 v, c
        read A_tote from "data.txt" with delimiter "\n"4 H9 V" |* r% {+ x. L; F# [
        read A_time from "data.txt" with delimiter "\n"8 b; X/ I0 \- b1 L+ E/ w
        read A_leave from "data.txt" with delimiter "\n"
5 }$ [1 J; A  ?4 H, }        read A_picks from "data.txt" with delimiter "\n"
) n" O# p4 b) G) {        set load type to A_tote
! A( ^( m" f, `4 R% S        if A_tote="tote 1" then set A_induct to 1
+ _& Q, `; W  y9 A8 ~; j  @4 M9 p        else if A_tote="tote 2" then set A_induct to 2
) C! e* L" `% q  u$ W6 i            else set A_induct to 3    & V3 {8 b$ g$ A1 C
        set A_i to 0, L' f& t1 Z2 [' i5 D- f6 e
        clone 1 load to P_induction
6 X7 w/ ^$ B5 I( n9 y. c1 y% k        wait for A_time sec
+ c# T- h! A3 }1 c* J! A    end
5 j. W0 s  ~2 V6 i) iend4 _* Z  z; x* \. F% t& @5 Y( N; W8 v* j
5 l: p7 ~5 s4 F7 Y" w* l
begin P_induction arriving# F) `7 |/ L8 V0 P: f( s8 i3 P
    if A_induct=1 then clone 1 load to P_pick1# G$ t) u$ @7 f0 p& [6 n( U
    else if A_induct=2 then clone 1 load to P_pick2
7 q8 i# c) R3 y$ B5 M% J        else clone 1 load to P_pick3
* |+ S4 @6 `2 M  G8 Y+ T  `* ?end$ N! Y# R8 J' z

( E! L0 e* N7 lbegin P_pick1 arriving- g- v, W1 b2 _
    set A_i to 18 w, {* p# `6 z  B6 O$ U* f# ^
    move into Q_induct16 J* d3 m" k+ b/ X! o1 K2 }
    move into pickaisle.induct1! e) x2 {  }3 \8 ?
    while A_i<=30 do begin4 g( a/ r: C' {& w$ p
        travel to pickaisle.con(A_i)
; G& n, _) G9 u5 @" V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 n) U5 h" m8 @6 T        else wait for 10 sec" H+ U" K4 i3 f1 X
        if A_i=A_leave then send to die5 i, |/ r' I" M
        else inc A_i by 1
2 f* i4 D: k! G: M    end3 y$ \/ s8 l# t: u6 B
end1 s# q: \$ l8 o4 |& \+ f

" p( }; w1 C. Z( Y( e: Abegin P_pick2 arriving
7 L0 u6 Q( I! f, J' R3 f6 u    set A_i to 11  S9 E. b* K, x& x
    move into Q_induct2
. w( n8 S; X, m; {0 I3 i    move into pickaisle.induct2# f* \, S. U1 H( {  V1 T3 K5 p
    while A_i<=30 do begin
: T3 g2 u4 I2 ^6 M& {/ U' F        travel to pickaisle.con(A_i)! o7 W4 F9 j  k6 X) ]) {) y; M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 D0 A) x3 p* i" k' J        else wait for 10 sec
( i# o% g, X# l        if A_i=A_leave then send to die
" W( U7 }4 D6 S2 o        else inc A_i by 1/ V6 D, x" c! Z% s2 e
    end
2 ^$ O+ O$ J  f! k! A3 hend
: l" `4 V2 ?6 L& N  g: `; j- ~* U
4 Z1 u- I3 @! Ebegin P_pick3 arriving/ n9 j& S! n( z6 `: H: c- D
    set A_i to 21) [; w; t" i+ J2 s" E' ~
    move into Q_induct3
+ N( p$ W5 s% w+ ^    move into pickaisle.induct3: W6 D9 p% E; X- N3 ]
    while A_i<=30 do begin
* W. }% A8 g* w9 A- Z- b! \3 U        travel to pickaisle.con(A_i)) P! V7 {: X$ }" Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* ?8 Z2 W; f' V$ D
        else wait for 10 sec
) Y6 f, b+ l- O0 r* t0 N6 N: X        if A_i=A_leave then send to die+ ?) R; u; o" `5 D) |7 h
        else inc A_i by 1
$ U( ^' ^0 O" e( j) ^; L& [    end8 Q  T# Y$ b% n+ Q# O
end

最佳答案

查看完整内容

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是个什么东东?6 [# _( ?8 u! B% W. N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ L8 z7 y( W1 ^# t* e- R

' h+ O: v3 q' UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. ?; _9 T' ]! M* C0 K5 c6 o9 x. q1 e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  {/ D$ C! n6 v# o* f( S5 B
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  I6 y! z! m9 B& J0 ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. K* G1 v/ Z+ P# P  ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) H& n) {! R  p# E! fbegin P_induction arriving( m7 n  m3 w4 i
    clone 1 load to P_pick(A_induct)
# D7 @$ l3 N% L; R4 }end最大的系" X+ u; q, m% O7 g
  }% f" J; \& l! q! J* x
begin P_pick arriving
' j0 ?3 `$ M/ G    set A_i to procindex * 10 + 1
4 U% _1 P) a/ ?/ g% x4 I  e    move into Q_induct(procindex), u) [3 o/ w7 `# i5 i6 y
    move into pickaisle.induct(procindex)6 _* c9 S; Y# T& ?% j' a8 R
    /*check the type of pickaisle.induct(i), for your last problem.*/% ?5 K9 V$ ?' C

8 c' R# p4 n" [8 |( _    while A_i<=30 do begin
( q1 E' K$ U9 h        travel to pickaisle.con(A_i)( t% x: v* I5 ]; N/ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& {, P1 N0 l' l) R% I- ?3 V6 ^
        else wait for 10 sec
! l2 b* N/ N1 N1 G7 h        if A_i=A_leave then send to die8 d/ W4 ]) B5 X) w; J/ n
        else inc A_i by 17 Q/ m2 g/ @; D7 Y+ ^) l
    end+ U" n* M4 ]+ N/ R/ M6 x" K" {
end2 u7 K5 Z1 P2 N

8 k. I5 C) c. `. v" c0 E其中的procindex为整形,代表当前process的序号。8 J, ?1 @: G& Q) K" f
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, 2026-7-5 08:53 , Processed in 0.017068 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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