设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15427|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" [4 w& S( Q! a5 w
- Z, d6 S1 t5 I! b) z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" i( J# Y  o1 r5 U; U4 \
! h& X4 R( j3 d. sbegin P_read arriving! d9 q) Q9 K9 d9 u1 J( L
    while 1=1 do begin6 N# q& u" f" j$ a. N. Q2 _
        read A_tote from "data.txt" with delimiter "\n"/ S4 L  f5 |$ M1 ^
        read A_time from "data.txt" with delimiter "\n"5 h7 P. U  W) O7 i
        read A_leave from "data.txt" with delimiter "\n"& s) ~- L/ [5 b9 q( M" ]% E/ H; @
        read A_picks from "data.txt" with delimiter "\n"
; ?6 c) t5 v, \( t; s        set load type to A_tote
- @5 I# F! u; T( P! ?( u1 t" S7 A! W        if A_tote="tote 1" then set A_induct to 1, k7 b! [+ O( `4 ^
        else if A_tote="tote 2" then set A_induct to 24 X& S( K, ?. E
            else set A_induct to 3   
+ W% M1 x2 v  R. w, J# }+ P. A4 N        set A_i to 0% F$ j9 s. A7 u3 @1 a: f
        clone 1 load to P_induction
" w2 O+ _3 ?/ j1 d        wait for A_time sec
# e6 s( X3 q8 B( X4 e9 j5 P% X( k3 d/ W    end$ D( }# X8 |' y: Q* N; L% j; U
end" J! W( r# K+ Z

( E  |! r/ h4 G+ }& Lbegin P_induction arriving
0 u0 Z. B9 X% ]7 ~    if A_induct=1 then clone 1 load to P_pick1
5 n4 N" Z0 p( x! ?, m1 c7 K    else if A_induct=2 then clone 1 load to P_pick2
0 ]/ \9 X. d9 E  N$ t        else clone 1 load to P_pick3
" c+ ~. `- ~, Oend$ u. i6 w8 R5 T( x+ f0 D8 K5 R
( D/ A7 E, N4 h* }, u' J
begin P_pick1 arriving9 s0 W. v" J# w( _- ], b
    set A_i to 1
; Z% d+ g* e+ W9 i2 |  c8 v" J2 n# e: D    move into Q_induct1
7 I- ]% K0 W! X" l! P7 U. p/ O" Z    move into pickaisle.induct17 A, m9 M5 n: ?: R
    while A_i<=30 do begin
' N0 [, R5 o  Q" W4 b0 d3 Z8 @        travel to pickaisle.con(A_i)
, B0 v/ k8 U0 @. \% v  u3 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 m+ E2 P* u) D% o, E% S. T, O" E        else wait for 10 sec4 E/ N2 h, }& p" S. u
        if A_i=A_leave then send to die. N. {  ?6 I2 s2 y! D# O! O
        else inc A_i by 1
# ?+ q- i4 {$ f, m5 T* \- x    end
1 C$ W5 j7 t, H9 L7 bend) x# E/ E% h! ~, h, t$ X# a! p

- j6 i- t3 o( c- n, ?& e# D. Dbegin P_pick2 arriving
3 _. h0 @. v5 E3 T    set A_i to 11$ L5 ?" X$ g' S- h$ u* b- h
    move into Q_induct2
3 R/ v( S5 [; d1 H/ A( Y: A    move into pickaisle.induct2
& h3 W2 @1 O3 L& ?    while A_i<=30 do begin. y6 \* m; i2 J6 H
        travel to pickaisle.con(A_i)
0 O3 z3 {3 f1 \/ v  o+ f9 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ b6 N, g4 r& S. @( ]. m
        else wait for 10 sec+ T6 U/ C: N, e2 E3 [! R; M
        if A_i=A_leave then send to die
2 l3 }6 T! a+ A* s        else inc A_i by 1% q! N  [8 y8 l$ j4 r; H& V
    end
8 m$ \) m+ m4 k, Kend% @: h7 P0 \* ?" g2 a. H6 L0 A

' X% [# |( A# q; w9 ubegin P_pick3 arriving/ W. P9 t8 s6 C* p
    set A_i to 21
9 E; ]$ P& g- n    move into Q_induct3$ ~0 @3 u0 f2 a5 E
    move into pickaisle.induct3
9 [8 s& c0 Q7 M9 x, O    while A_i<=30 do begin
# W* `9 p7 Q+ S+ K        travel to pickaisle.con(A_i)
3 u1 E3 }- V( A& t8 R* \. x- K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( w3 S* i0 ?1 f3 T4 l5 _1 ~0 Z7 `        else wait for 10 sec! _9 T4 h+ g; _9 V
        if A_i=A_leave then send to die5 ^) @9 }8 ^0 x: b' n- r0 H2 I
        else inc A_i by 1% ?1 ]! O4 }  C6 q3 C9 F& \7 z2 m8 x7 I( }" L
    end
4 R, [  [4 ~4 M  T7 ~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是个什么东东?* I; i( T6 d4 D3 ~( h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; \8 L$ n* c$ T- y" D

- |3 ~, Y: l9 j, q  FAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) Q) `& K  j+ d: T, u
2 ~0 f  h/ Y  l) D2 w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 A! H* j; O7 q5 a+ H- V1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 s2 s8 k' P& L0 ~! `9 P! p5 Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ m) c! [% I" u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 p: z) `3 l% N5 d9 t# |# K9 G9 w
begin P_induction arriving
3 G1 r3 y( P0 X4 s4 J" o    clone 1 load to P_pick(A_induct)$ ?0 s! r; A# T5 ^+ ?3 J
end最大的系  X9 q% {0 u9 w, z
3 l, d! u6 p  S
begin P_pick arriving
( c0 X, _5 D; y0 K/ K3 L    set A_i to procindex * 10 + 1
0 k7 j5 W8 ]  o" G' t+ S0 c1 V6 `    move into Q_induct(procindex)
* C" r1 |0 u- r8 t$ ?; P0 [    move into pickaisle.induct(procindex)2 ^# w7 d# q6 v& G$ |7 |# i, l8 k$ n
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 u; F4 P3 m; o* U0 n* A' ?3 A: r" P- V  x- M0 J3 q
    while A_i<=30 do begin
; N1 s* m  f2 x2 d4 G        travel to pickaisle.con(A_i)
5 L# v) U$ e+ s3 l& N! b- j3 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ v" W, d" H) v7 Y/ M  `
        else wait for 10 sec
# {1 a# h- e" v        if A_i=A_leave then send to die
. h% }) d8 N2 E: Y& Q        else inc A_i by 1
; L7 f, G7 P$ x0 M* |/ [    end+ ?8 ]( X3 K: }* f7 \
end5 |% [+ E7 A( e! k8 K0 O2 p
5 h6 `% A$ u+ s3 r7 R# u3 S4 w
其中的procindex为整形,代表当前process的序号。
" p$ S0 S+ L! vstation和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-9-10 12:57 , Processed in 0.016200 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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